home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / flush.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  1.2 KB  |  60 lines  |  [TEXT/ttxt]

  1. connect (con1,localhost,root,,);
  2. connect (con2,localhost,root,,);
  3. connection con1;
  4. drop table if exists t1;
  5. create temporary table t1(n int not null primary key);
  6. drop table if exists t2;
  7. create table t2(n int);
  8. insert into t2 values(3);
  9. let $1=100;
  10. while ($1)
  11. {
  12.  connection con1;
  13.  send replace into t1 select n from t2;
  14.  connection con2;
  15.  send flush tables;
  16.  connection con1;
  17.  reap;
  18.  connection con2;
  19.  reap;
  20.  dec $1;
  21. }
  22.  
  23. connection con1;
  24. select * from t1;
  25. connection con2;
  26. flush tables with read lock;
  27. --error 1099;
  28. drop table t2;
  29. connection con1;
  30. send drop table t2;
  31. connection con2;
  32. unlock tables;
  33. connection con1;
  34. reap;
  35.  
  36. #test if drop database will wait until we release the global read lock
  37. connection con1;
  38. drop database if exists foo;
  39. create database foo;
  40. create table foo.t1(n int);
  41. insert into foo.t1 values (23);
  42. flush tables with read lock;
  43. connection con2;
  44. send drop database foo;
  45. connection con1;
  46. select * from foo.t1;
  47. unlock tables;
  48. connection con2;
  49. reap;
  50.  
  51. # test if dirty close releases global read lock
  52. connection con1;
  53. create table t1 (n int);
  54. flush tables with read lock;
  55. dirty_close con1;
  56. connection con2;
  57. insert into t1 values (345);
  58. select * from t1;
  59. drop table t1;
  60.